package com.chenfan.mcn.model;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.chenfan.mcn.extension.log.FieldDesc;
import com.chenfan.mcn.constant.DictTypeCst;
import com.chenfan.mcn.constant.McnConstant;
import com.chenfan.mcn.component.dict.BrandCodeTranslator;
import com.chenfan.mcn.component.dict.CustomerIdTranslator;
import com.chenfan.mcn.component.dict.UserIdTranslator;
import com.chenfan.mcn.model.base.BaseOwnerEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 * 直播合同商品表
 * </p>
 *
 * @author wulg
 * @since 2023-03-13
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("live_contract_commodity")
public class LiveContractCommodity extends BaseOwnerEntity {

    @TableField(exist = false)
    private BigDecimal transactedPrice;

    /**
     * 直播场次ID
     */
    private Long lsId;
    
    /**
     * 商品ID
     */
    @FieldDesc(value = "商品ID")
    @TableField("commodity_id")
    @Excel(name = "商品ID")
    private String commodityId;

    /**
     * 商品名称
     */
    @FieldDesc(value = "商品名称")
    @TableField("commodity_name")
    @Excel(name = "商品名称")
    private String commodityName;


    /**
     * 认领状态：0待认领、1已认领
     */
    @FieldDesc(value = "认领状态", replace = {"待认领_0", "已认领_1"})
    @TableField("claim_status")
    private Integer claimStatus;

    /**
     * 结算状态：0待结算、1结算中、2已结算、3待财务导入、4、部分结算
     */
    @FieldDesc(value = "结算状态", replace = {"待结算_0", "结算中_1", "已结算_2","待财务导入_3","部分结算_4"})
    @TableField("settlement_status")
    private Integer settlementStatus;

    /**
     * 招商ID（取EOP启用中的用户ID）
     */
    @FieldDesc(value = "招商", translator = UserIdTranslator.class)
    @TableField("franchiser_id")
    private Long franchiserId;

    /**
     * 客户ID
     */
    @FieldDesc(value = "客户名称", translator = CustomerIdTranslator.class)
    @TableField("customer_id")
    private Long customerId;
    
    /**
     * 讲解次数
     */
    @FieldDesc(value = "讲解次数")
    @TableField("expound_num")
    @Excel(name = "讲解次数")
    private Integer expoundNum;

    /**
     * 首次上架时间
     */
    @FieldDesc(value = "首次上架时间")
    @TableField("first_new_date")
    @Excel(name = "首次上架时间", exportFormat = McnConstant.LONG_DATE_FORMAT)
    private Date firstNewDate;

    /**
     * 直播间价格
     */
    @FieldDesc(value = "直播间价格'")
    @TableField("live_price")
    @Excel(name = "直播间价格")
    private BigDecimal livePrice;

    /**
     * 成交金额
     */
    @FieldDesc(value = "成交金额")
    @TableField("transacted_amount")
    @Excel(name = "成交金额")
    private BigDecimal transactedAmount;

    /**
     * 成交件数
     */
    @FieldDesc(value = "成交件数")
    @TableField("transacted_qty")
    @Excel(name = "成交件数")
    private BigDecimal transactedQty;

    /**
     * 预售订单数
     */
    @FieldDesc(value = "预售订单数")
    @TableField("presale_order_num")
    @Excel(name = "预售订单数")
    private BigDecimal presaleOrderNum;

    /**
     * 商品点击人数
     */
    @FieldDesc(value = "商品点击人数")
    @TableField("click_num")
    @Excel(name = "商品点击人数")
    private BigDecimal clickNum;

    /**
     * 商品曝光-点击率（人数）
     */
    @FieldDesc(value = "商品曝光-点击率（人数）")
    @TableField("click_rate")
    @Excel(name = "商品曝光-点击率（人数）", suffix = "%")
    private BigDecimal clickRate;

    /**
     * 商品点击-成交转化率（人数）
     */
    @FieldDesc(value = "商品点击-成交转化率（人数）")
    @TableField("trade_transf_rate")
    @Excel(name = "商品点击-成交转化率（人数）", suffix = "%")
    private BigDecimal tradeTransfRate;

    /**
     * 商品支付GPM
     */
    @FieldDesc(value = "商品支付GPM")
    @TableField("pay_gpm")
    @Excel(name = "商品支付GPM")
    private BigDecimal payGpm;

    /**
     * 发货前退款订单数
     */
    @FieldDesc(value = "发货前退款订单数")
    @TableField("before_refund_order_num")
    @Excel(name = "发货前退款订单数")
    private BigDecimal beforeRefundOrderNum;

    /**
     * 发货前退款金额
     */
    @FieldDesc(value = "发货前退款金额")
    @TableField("before_refund_amount")
    @Excel(name = "发货前退款金额")
    private BigDecimal beforeRefundAmount;

    /**
     * 发货前退款人数
     */
    @FieldDesc(value = "发货前退款人数")
    @TableField("before_refund_num")
    @Excel(name = "发货前退款人数")
    private BigDecimal beforeRefundNum;

    /**
     * 发货前订单退款率
     */
    @FieldDesc(value = "发货前订单退款率")
    @TableField("before_refund_rate")
    @Excel(name = "发货前订单退款率", suffix = "%")
    private BigDecimal beforeRefundRate;

    /**
     * 发货后退款订单数
     */
    @FieldDesc(value = "发货后退款订单数")
    @TableField("after_refund_order_num")
    @Excel(name = "发货后退款订单数")
    private BigDecimal afterRefundOrderNum;

    /**
     * 发货后退款金额
     */
    @FieldDesc(value = "发货后退款金额")
    @TableField("after_refund_amount")
    @Excel(name = "发货后退款金额")
    private BigDecimal afterRefundAmount;

    /**
     * 发货后退款人数
     */
    @FieldDesc(value = "发货后退款人数")
    @TableField("after_refund_num")
    @Excel(name = "发货后退款人数")
    private BigDecimal afterRefundNum;

    /**
     * 发货后订单退款率
     */
    @FieldDesc(value = "发货后订单退款率")
    @TableField("after_refund_rate")
    @Excel(name = "发货后订单退款率", suffix = "%")
    private BigDecimal afterRefundRate;

    /**
     * 关联的收入合同ID
     */
    @TableField("income_contract_id")
    private Long incomeContractId;

    /**
     * 关联的收入合同编号
     */
    @FieldDesc(value = "收入合同编号")
    @TableField("income_contract_code")
    private String incomeContractCode;

    /**
     * 品牌（数据字典）
     */
    @FieldDesc(value = "品牌", translator = BrandCodeTranslator.class)
    @TableField("cooperate_brand")
    private String cooperateBrand;

    /**
     * 品牌类目（取自liveContractCategory）
     */
    @FieldDesc(value = "品牌类目", dictType = DictTypeCst.LIVE_CONTRACT_CATEGORY)
    @TableField("live_contract_category")
    private String liveContractCategory;
}
